/* eslint-disable */
// import axios from 'axios'
import MockAdapter from 'axios-mock-adapter'
// import Demo from './demo'
import app from './app'
// import As from './litong/as.js'
// import asMock from './badehua/asMock.js'
// import itemForm from './liyuetong/itemForm.js'

//import Zhang from './zhangfan/as.js'
import Tas from './as'
import Esp from './esp'
export default {
  /**
   * mock bootstrap
   */
  bootstrap() {
    const mock = new MockAdapter(axios)
    // 首页请求数据
    mock.onPost('/config/home').reply(() => {
      return new Promise(resolve => {
        setTimeout(() => {
          resolve([200, Tas.homeConfig()])
        }, 1000)
      })
    })
    // 产品列表页请求数据
    mock.onPost('/item/list').reply(() => {
      return new Promise(resolve => {
        setTimeout(() => {
          resolve([200, Tas.productList()])
        }, 1000)
      })
    })
    // 个人中心页及个人信息页请求数据
    mock.onPost('/agent/info').reply(() => {
      return new Promise(resolve => {
        setTimeout(() => {
          resolve([200, Esp.agentInfo()])
        }, 1000)
      })
    })
    // 计划书列表页请求数据
    mock.onPost('/agent/proposal/queryList').reply(() => {
      return new Promise(resolve => {
        setTimeout(() => {
          resolve([200, Esp.proposalList()])
        }, 1000)
      })
    })
    // 分享接口请求数据
    mock.onPost('/util/share').reply(() => {
      return new Promise(resolve => {
        setTimeout(() => {
          resolve([200, Tas.share()])
        }, 1000)
      })
    })
    // 订单列表页请求数据
    mock.onGet('/agent/order/list').reply(() => {
      return new Promise(resolve => {
        setTimeout(() => {
          resolve([200, Esp.orderList()])
        }, 1000)
      })
    })
    // 健康告知页请求数据
    mock.onPost('/customer/product/showImpart').reply(() => {
      return new Promise(resolve => {
        setTimeout(() => {
          resolve([200, Esp.showImpart()])
        }, 1000)
      })
    })
    // 投保人确认接口
    mock.onPost('/customer/insure/appntCheck').reply(() => {
      return new Promise(resolve => {
        setTimeout(() => {
          resolve([200, Esp.appntCheck()])
        }, 1000)
      })
    })
    // 投保信息查询接口
      mock.onPost('/item/form').reply(() => {
          return new Promise(resolve => {
              setTimeout(() => {
                  resolve([200, Tas.insuranceList()])
              }, 1000)
          })
      })
      // 订单保存接口
      mock.onPost('/agent/insure/saveOrder').reply(() => {
          return new Promise(resolve => {
              setTimeout(() => {
                  resolve([200, Esp.saveOrder()])
              }, 1000)
          })
      })
    //产品试算
      mock.onPost('/customer/insure/charge').reply(() => {
          return new Promise(resolve => {
              setTimeout(() => {
                  resolve([200, Esp.insureCharge()])
              }, 1000)
          })
      })

    mock.onGet('/agent/order/detail').reply(() => {
      return new Promise(resolve => {
        setTimeout(() => {
          resolve([200, Esp.getOrderDetail()])
        }, 1000)
      })
    })
    mock.onPost('/order/status').reply(200,Tas.getOrderStatus())
    mock.onPost('/common/checkSign').reply(200,Esp.getCheckSign())
    mock.onPost('/customer/order/detail').reply(() => {
      return new Promise(resolve => {
        setTimeout(() => {
          resolve([200, Esp.getOrderDetail()])
        }, 1000)
      })
    })  
    mock.onPost('/uploader/common').reply(200,Esp.uploaderImg())
    mock.onPost('/pay/payLimit').reply(200,Tas.bankLimit())
    mock.onPost('/pay/cardbin').reply(200,Tas.bankDetail())
    mock.onGet('/verify/graph').reply(200,Esp.getGraphId())
    mock.onPost('/verify/sms').reply(200,Esp.getNoteCode())
    // 支付承保接口
    mock.onPost('/customer/insure/accInsurance').reply(() => {
      return new Promise(resolve => {
        setTimeout(() => {
          resolve([200, Esp.accInsurance()])
        }, 1000)
      })
    })
    mock.onPost('/customer/insure/artificial').reply(() => {
      return new Promise(resolve => {
        setTimeout(() => {
          resolve([200, Esp.artificial()])
        }, 1000)
      })
    })
    mock.onPost('/customer/proposal/queryDetail').reply(() => {
      return new Promise(resolve => {
        setTimeout(() => {
          resolve([200, Esp.customerProposal()])
        }, 1000)
      })
    })
    mock.onPost('/proposal/benecharge').reply(() => {
      return new Promise(resolve => {
        setTimeout(() => {
          resolve([200, Esp.benecharge()])
        }, 1000)
      })
    })
    mock.onPost('/proposal/getShow').reply(() => {
      return new Promise(resolve => {
        setTimeout(() => {
          resolve([200, Tas.getProposal()])
        }, 1000)
      })
    })
    // as2.1查询详情
    mock.onPost('/item/get').reply(200,Tas.getItem())
    // as2.2制作计划书查询接口
    mock.onPost('/proposal/getConfig').reply(200,Tas.doProposal())

    mock.onPost('/agent/proposal/queryDetail').reply(200, Esp.agentProposal())
    
    mock.onPost('/agent/proposal/save').reply(200,Esp.saveProposal())

    app.doAppMock()
    mock.onAny().passThrough()
  }

}